import Vue from 'vue'
import Router from 'vue-router'
import TabBar from '../components/TabBar'
import Home from '../pages/Home'

Vue.use(Router)

export default new Router({
  linkActiveClass:"is-active",
  routes: [
    {
      path:'/',
      component:TabBar,
      redirect:'/home',
      children:[
        {
          path:'home',
          component:Home
        },
        {
          path:'share',
          component:resolve=>{
            require(['../pages/Share'],resolve)
        }
        },
        {
          path:'edit',
          component:resolve=>{
            require(['../pages/Edit'],resolve)
          }
        },
        {
          path:'job',
          component:resolve=>{
            require(['../pages/Job'],resolve)
          }
        },
      ]
    },
    {
      path:'/create',
      component:resolve=>{
        require(['../pages/Create'],resolve)
      }
    },
    {
      path:'/mine',
      component:resolve=>{
        require(['../pages/Mine'],resolve)
      }
    },
    {
      path:'/everylist/:id',
      component:resolve=>{
        require(['../pages/EveryList'],resolve)
      }
    },
    {
      path:'/login',
      component:resolve=>{
        require(['../pages/Login'],resolve)
      }
    },
    {
      path:'/myanswer/:topId',
      component:resolve=>{
        require(['../components/MyAnswer'],resolve)
      }
    },
    {
      path:'/userhome',
      component:resolve=>{
        require(['../pages/UserHome'],resolve)
      }
    },
    {
      path:'/mycomment/:topId/:replyId',
      component:resolve=>{
        require(['../components/MyComment'],resolve)
      }
    },
    {
      path:'/mycollection',
      component:resolve=>{
        require(['../pages/MyCollection'],resolve)
      }
    },
    {
      path:'/myshare',
      component:resolve=>{
        require(['../pages/MyShare'],resolve)
      }
    },
    {
      path:'/mymessage',
      component:resolve=>{
        require(['../pages/MyMessage'],resolve)
      }
    }
  ]
})
